package com.panshi.service;


import com.panshi.entity.AppEssayT;
import com.panshi.entity.ClassifyT;
import com.panshi.entity.SysEssayCheckT;
import com.panshi.service.impl.ZxClientServiceFallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
@FeignClient(value = "HASBEI-ZX-PROVIDER-8002-XHLMR",fallbackFactory = ZxClientServiceFallbackFactory.class)
public interface ZxClientService {
    //增加评论量
    @GetMapping("/app-essay-t/essayCommAdd/{essayId}")
    public Boolean essayCommAdd(@PathVariable int essayId);

    //乐观锁增加浏览量
    @GetMapping("/app-essay-t/essayReadAdd/{essayId}")
    public Boolean essayReadAdd(@PathVariable int essayId);

    @GetMapping("/app-essay-t/zxAll")
    public List<AppEssayT> zxAll();

    @GetMapping("/app-essay-t/zxbyid/{id}")
    public AppEssayT zxbyid(@PathVariable Integer id);


    @ApiOperation("咨询审核表添加")
    @PostMapping("/sys-essay-check-t/zxAdd")
    public Boolean zxAdd(@RequestBody SysEssayCheckT sysEssayCheckT);

    @GetMapping("/app-essay-t/zxPage/{page}/{limit}/{type}")
    public List<AppEssayT> zxPage(@PathVariable int page, @PathVariable int limit,@PathVariable String type);

    @ApiOperation("咨询分页查询  cid分类  page咨询页数 ，limit 多少  type排序")
    @GetMapping("/app-essay-t/zxCPage/{cid}/{page}/{limit}/{type}")
    public List<AppEssayT> zxCPage(
            @PathVariable("cid") int cid,
            @PathVariable("page") int page,
            @PathVariable("limit") int limit,
            @PathVariable("type") String type);

    @GetMapping("/classify-t/all")
    public List<ClassifyT> call();

    @GetMapping("/classify-t/bycid/{id}")
    public ClassifyT bycid(@PathVariable("id") Integer id);

    @ApiOperation("查询咨询 id查询")
    @GetMapping("/sys-essay-check-t/secLikeState/{essayTitle}/{status}/{page}/{limit}")
    public List<SysEssayCheckT> secLikeState(@PathVariable String essayTitle, @PathVariable String status, @PathVariable int page, @PathVariable int limit);

    @ApiOperation("查询咨询审核表全部数据")
    @GetMapping("/sys-essay-check-t/secAll")
    public List<SysEssayCheckT> secAll();

    @ApiOperation("咨询审核表按ID查询")
    @GetMapping("/sys-essay-check-t/secById/{sysEssId}")
    public SysEssayCheckT secById(@PathVariable int sysEssId);

    @ApiOperation("咨询审核通过")
    @GetMapping("/sys-essay-check-t/updPossAdd/{sysEssayId}/{describe}")
    public Boolean updPossAdd(@PathVariable int sysEssayId,@PathVariable String describe);

    @ApiOperation("咨询审核未通过")
    @GetMapping("/sys-essay-check-t/updNotAdd/{sysEssayId}/{describe}")
    public Boolean updNotAdd(@PathVariable int sysEssayId,@PathVariable String describe);

    @ApiOperation("咨询审核下架")
    @GetMapping("/sys-essay-check-t/essayDel/{essayId}/{describe}")
    public boolean essayDel(@PathVariable int essayId,@PathVariable String describe);

    @ApiOperation("咨询上架")
    @GetMapping("/sys-essay-check-t/essayPut/{essayId}/{describe}")
    public Boolean essayPut(@PathVariable int essayId,@PathVariable String describe);
}
